<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

class AlertTypeToBannerTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('banner', function (Blueprint $table) {
            $table->unsignedBigInteger('productId')->default(0)->comment("菜品Id");
            $table->string('bannerJoinId',255)->default('')->comment("关联bannerId,形式:,1,2,");
            DB::statement(
                "ALTER TABLE `kf_rms`.`kf_banner` MODIFY COLUMN `type` tinyint UNSIGNED NOT NULL DEFAULT 0 
    COMMENT '类型 0-首页，1-banner，2-副屏，3-弹窗，4-展示屏 - 1号位，5-展示屏 - 2号位，6-展示屏 - 3号位，7-展示屏 - 4号位，8-商屏素材-组合，9-商屏素材-单品';"
            );

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('banner', function (Blueprint $table) {
            $table->dropColumn('productId');
        });
    }
}
